#include <cstdio>
#include <cstring>
#include "queue.h"
#include <fcntl.h>

int main(int argc, char **argv)
{
	char buf[1024 * 8];
	while (recv_msg(SERVICE_QUEUE_RSP, buf, sizeof(buf), O_NONBLOCK) > 0) {
		printf(SERVICE_QUEUE_RSP "recvmsg:%s\n", buf);
	}
	while (recv_msg(CLOUD_QUEUE, buf, sizeof(buf), O_NONBLOCK) > 0) {
		printf(CLOUD_QUEUE "recvmsg:%s\n", buf);
	}
	while (recv_msg(CTRL_QUEUE, buf, sizeof(buf), O_NONBLOCK) > 0) {
		printf(CTRL_QUEUE "recvmsg:%s\n", buf);
	}
	return 0;
}